%3
a = cell(3,9);
a{1,1} = [1 "I"];
a{1,2} = [2 "II"];
a{1,3} = [3 "III"];
a{1,4} = [4 "IV"];
a{1,5} = [5 "V"];
a{1,6} = [6 "VI"];
a{1,7} = [7 "VII"];
a{1,8} = [8 "VIII"];
a{1,9} = [9 "IX"];
a{2,1} = [1 "X"];
a{2,2} = [2 "XX"];
a{2,3} = [3 "XXX"];
a{2,4} = [4 "XL"];
a{2,5} = [5 "L"];
a{2,6} = [6 "LX"];
a{2,7} = [7 "LXX"];
a{2,8} = [8 "LXXX"];
a{2,9} = [9 "XC"];
a{3,1} = [1 "C"];
a{3,2} = [2 "CC"];
a{3,3} = [3 "CCC"];
a{3,4} = [4 "CD"];
a{3,5} = [5 "D"];
a{3,6} = [6 "DC"];
a{3,7} = [7 "DCC"];
a{3,8} = [8 "DCCC"];
a{3,9} = [9 "CM"];

s = input('请输入一个值');
s = num2str(s);
n = strlength(s);
str = string();
for i = n:-1:1
    for j = 1:1:9
    if s(n-i+1) == a{i,j}(1,1)
        str = strcat(str,a{i,j}(1,2));
    end
    end
end
fprintf('%s',str)

  
   